3.5.68 \(\int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))^2} \, dx\) [468]

Optimal. Leaf size=221 \[ \frac {2 d^2 (3 c+2 d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{a^2 (c-d)^3 (c+d) \sqrt {c^2-d^2} f}-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \]

[Out]

-1/3*d*(c^2-6*c*d-10*d^2)*cos(f*x+e)/a^2/(c-d)^3/(c+d)/f/(c+d*sin(f*x+e))-1/3*(c-6*d)*cos(f*x+e)/a^2/(c-d)^2/f
/(1+sin(f*x+e))/(c+d*sin(f*x+e))-1/3*cos(f*x+e)/(c-d)/f/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))+2*d^2*(3*c+2*d)*ar
ctan((d+c*tan(1/2*f*x+1/2*e))/(c^2-d^2)^(1/2))/a^2/(c-d)^3/(c+d)/f/(c^2-d^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.29, antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {2845, 3057, 2833, 12, 2739, 632, 210} \begin {gather*} \frac {2 d^2 (3 c+2 d) \text {ArcTan}\left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{a^2 f (c-d)^3 (c+d) \sqrt {c^2-d^2}}-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 f (c-d)^3 (c+d) (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 f (c-d)^2 (\sin (e+f x)+1) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 f (c-d) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/((a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^2),x]

[Out]

(2*d^2*(3*c + 2*d)*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(a^2*(c - d)^3*(c + d)*Sqrt[c^2 - d^2]*f)
 - (d*(c^2 - 6*c*d - 10*d^2)*Cos[e + f*x])/(3*a^2*(c - d)^3*(c + d)*f*(c + d*Sin[e + f*x])) - ((c - 6*d)*Cos[e
 + f*x])/(3*a^2*(c - d)^2*f*(1 + Sin[e + f*x])*(c + d*Sin[e + f*x])) - Cos[e + f*x]/(3*(c - d)*f*(a + a*Sin[e
+ f*x])^2*(c + d*Sin[e + f*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2739

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[2*(e/d), Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2833

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(
b*c - a*d))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + Dist[1/((m + 1)*(a^2 - b
^2)), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[(a*c - b*d)*(m + 1) - (b*c - a*d)*(m + 2)*Sin[e + f*x], x], x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rule 2845

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[b^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Dis
t[1/(a*(2*m + 1)*(b*c - a*d)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[b*c*(m + 1) - a*d*
(2*m + n + 2) + b*d*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d,
0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -1] &&  !GtQ[n, 0] && (IntegersQ[2*m, 2*n] || (IntegerQ
[m] && EqQ[c, 0]))

Rule 3057

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*
x])^(n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Dist[1/(a*(2*m + 1)*(b*c - a*d)), Int[(a + b*Sin[e + f*x])^(m +
 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b*d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*
(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2
- b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] &&  !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c,
0])

Rubi steps

\begin {align*} \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))^2} \, dx &=-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}-\frac {\int \frac {-a (c-4 d)-2 a d \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))^2} \, dx}{3 a^2 (c-d)}\\ &=-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}+\frac {\int \frac {10 a^2 d^2+a^2 (c-6 d) d \sin (e+f x)}{(c+d \sin (e+f x))^2} \, dx}{3 a^4 (c-d)^2}\\ &=-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}-\frac {\int -\frac {3 a^2 d^2 (3 c+2 d)}{c+d \sin (e+f x)} \, dx}{3 a^4 (c-d)^3 (c+d)}\\ &=-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}+\frac {\left (d^2 (3 c+2 d)\right ) \int \frac {1}{c+d \sin (e+f x)} \, dx}{a^2 (c-d)^3 (c+d)}\\ &=-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}+\frac {\left (2 d^2 (3 c+2 d)\right ) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{a^2 (c-d)^3 (c+d) f}\\ &=-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}-\frac {\left (4 d^2 (3 c+2 d)\right ) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{a^2 (c-d)^3 (c+d) f}\\ &=\frac {2 d^2 (3 c+2 d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{a^2 (c-d)^3 (c+d) \sqrt {c^2-d^2} f}-\frac {d \left (c^2-6 c d-10 d^2\right ) \cos (e+f x)}{3 a^2 (c-d)^3 (c+d) f (c+d \sin (e+f x))}-\frac {(c-6 d) \cos (e+f x)}{3 a^2 (c-d)^2 f (1+\sin (e+f x)) (c+d \sin (e+f x))}-\frac {\cos (e+f x)}{3 (c-d) f (a+a \sin (e+f x))^2 (c+d \sin (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.87, size = 267, normalized size = 1.21 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (2 (c-d) \sin \left (\frac {1}{2} (e+f x)\right )-(c-d) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+2 (c-7 d) \sin \left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2+\frac {6 d^2 (3 c+2 d) \tan ^{-1}\left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3}{(c+d) \sqrt {c^2-d^2}}+\frac {3 d^3 \cos (e+f x) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3}{(c+d) (c+d \sin (e+f x))}\right )}{3 a^2 (c-d)^3 f (1+\sin (e+f x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/((a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^2),x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(2*(c - d)*Sin[(e + f*x)/2] - (c - d)*(Cos[(e + f*x)/2] + Sin[(e + f*x)
/2]) + 2*(c - 7*d)*Sin[(e + f*x)/2]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2 + (6*d^2*(3*c + 2*d)*ArcTan[(d + c
*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^3)/((c + d)*Sqrt[c^2 - d^2]) + (3*d^
3*Cos[e + f*x]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^3)/((c + d)*(c + d*Sin[e + f*x]))))/(3*a^2*(c - d)^3*f*(1
 + Sin[e + f*x])^2)

________________________________________________________________________________________

Maple [A]
time = 0.65, size = 205, normalized size = 0.93

method result size
derivativedivides \(\frac {-\frac {2 \left (c -3 d \right )}{\left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {4}{3 \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {2}{\left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {2 d^{2} \left (\frac {\frac {d^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}+\frac {d}{c +d}}{c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\left (3 c +2 d \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right )^{3}}}{a^{2} f}\) \(205\)
default \(\frac {-\frac {2 \left (c -3 d \right )}{\left (c -d \right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {4}{3 \left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {2}{\left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {2 d^{2} \left (\frac {\frac {d^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c +d \right ) c}+\frac {d}{c +d}}{c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c}+\frac {\left (3 c +2 d \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c +d \right ) \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right )^{3}}}{a^{2} f}\) \(205\)
risch \(\frac {-16 i d^{3} {\mathrm e}^{i \left (f x +e \right )}+4 c \,d^{2}+6 c \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-34 d^{2} {\mathrm e}^{2 i \left (f x +e \right )} c -\frac {2 c^{2} d}{3}+6 i c^{2} d \,{\mathrm e}^{3 i \left (f x +e \right )}-6 i c^{2} d \,{\mathrm e}^{i \left (f x +e \right )}+\frac {4 i c^{3} {\mathrm e}^{i \left (f x +e \right )}}{3}-\frac {46 d \,c^{2} {\mathrm e}^{2 i \left (f x +e \right )}}{3}+4 c^{3} {\mathrm e}^{2 i \left (f x +e \right )}+22 i c \,d^{2} {\mathrm e}^{3 i \left (f x +e \right )}-\frac {58 i c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}}{3}+4 d^{3} {\mathrm e}^{4 i \left (f x +e \right )}-\frac {44 d^{3} {\mathrm e}^{2 i \left (f x +e \right )}}{3}+12 i d^{3} {\mathrm e}^{3 i \left (f x +e \right )}+\frac {20 d^{3}}{3}}{\left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{3} \left (c +d \right ) \left (d \,{\mathrm e}^{2 i \left (f x +e \right )}-d +2 i c \,{\mathrm e}^{i \left (f x +e \right )}\right ) \left (c -d \right )^{3} f \,a^{2}}-\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) c}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) \left (c -d \right )^{3} f \,a^{2}}-\frac {2 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) \left (c -d \right )^{3} f \,a^{2}}+\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) c}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) \left (c -d \right )^{3} f \,a^{2}}+\frac {2 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c +d \right ) \left (c -d \right )^{3} f \,a^{2}}\) \(618\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

2/f/a^2*(-(c-3*d)/(c-d)^3/(tan(1/2*f*x+1/2*e)+1)-2/3/(c-d)^2/(tan(1/2*f*x+1/2*e)+1)^3+1/(c-d)^2/(tan(1/2*f*x+1
/2*e)+1)^2+d^2/(c-d)^3*((d^2/(c+d)/c*tan(1/2*f*x+1/2*e)+d/(c+d))/(c*tan(1/2*f*x+1/2*e)^2+2*d*tan(1/2*f*x+1/2*e
)+c)+(3*c+2*d)/(c+d)/(c^2-d^2)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2))))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d^2-4*c^2>0)', see `assume?`
 for more de

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 1124 vs. \(2 (219) = 438\).
time = 0.44, size = 2342, normalized size = 10.60 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

[1/6*(2*c^5 - 2*c^4*d - 4*c^3*d^2 + 4*c^2*d^3 + 2*c*d^4 - 2*d^5 - 2*(c^4*d - 6*c^3*d^2 - 11*c^2*d^3 + 6*c*d^4
+ 10*d^5)*cos(f*x + e)^3 + 2*(c^5 - 5*c^4*d - 8*c^3*d^2 + c^2*d^3 + 7*c*d^4 + 4*d^5)*cos(f*x + e)^2 - 3*(6*c^2
*d^2 + 10*c*d^3 + 4*d^4 - (3*c*d^3 + 2*d^4)*cos(f*x + e)^3 - (3*c^2*d^2 + 8*c*d^3 + 4*d^4)*cos(f*x + e)^2 + (3
*c^2*d^2 + 5*c*d^3 + 2*d^4)*cos(f*x + e) + (6*c^2*d^2 + 10*c*d^3 + 4*d^4 - (3*c*d^3 + 2*d^4)*cos(f*x + e)^2 +
(3*c^2*d^2 + 5*c*d^3 + 2*d^4)*cos(f*x + e))*sin(f*x + e))*sqrt(-c^2 + d^2)*log(-((2*c^2 - d^2)*cos(f*x + e)^2
- 2*c*d*sin(f*x + e) - c^2 - d^2 - 2*(c*cos(f*x + e)*sin(f*x + e) + d*cos(f*x + e))*sqrt(-c^2 + d^2))/(d^2*cos
(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2)) + 2*(2*c^5 - 5*c^4*d - 16*c^3*d^2 - 8*c^2*d^3 + 14*c*d^4 + 13*d
^5)*cos(f*x + e) - 2*(c^5 - c^4*d - 2*c^3*d^2 + 2*c^2*d^3 + c*d^4 - d^5 - (c^4*d - 6*c^3*d^2 - 11*c^2*d^3 + 6*
c*d^4 + 10*d^5)*cos(f*x + e)^2 - (c^5 - 4*c^4*d - 14*c^3*d^2 - 10*c^2*d^3 + 13*c*d^4 + 14*d^5)*cos(f*x + e))*s
in(f*x + e))/((a^2*c^6*d - 2*a^2*c^5*d^2 - a^2*c^4*d^3 + 4*a^2*c^3*d^4 - a^2*c^2*d^5 - 2*a^2*c*d^6 + a^2*d^7)*
f*cos(f*x + e)^3 + (a^2*c^7 - 5*a^2*c^5*d^2 + 2*a^2*c^4*d^3 + 7*a^2*c^3*d^4 - 4*a^2*c^2*d^5 - 3*a^2*c*d^6 + 2*
a^2*d^7)*f*cos(f*x + e)^2 - (a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d
^5 - a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e) - 2*(a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*
d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f + ((a^2*c^6*d - 2*a^2*c^5*d^2 - a^2*c^4*d^3 + 4*a^2*c^3*d^4 - a^2
*c^2*d^5 - 2*a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e)^2 - (a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*
a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e) - 2*(a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^2 + 3
*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f)*sin(f*x + e)), 1/3*(c^5 - c^4*d - 2*c^3
*d^2 + 2*c^2*d^3 + c*d^4 - d^5 - (c^4*d - 6*c^3*d^2 - 11*c^2*d^3 + 6*c*d^4 + 10*d^5)*cos(f*x + e)^3 + (c^5 - 5
*c^4*d - 8*c^3*d^2 + c^2*d^3 + 7*c*d^4 + 4*d^5)*cos(f*x + e)^2 + 3*(6*c^2*d^2 + 10*c*d^3 + 4*d^4 - (3*c*d^3 +
2*d^4)*cos(f*x + e)^3 - (3*c^2*d^2 + 8*c*d^3 + 4*d^4)*cos(f*x + e)^2 + (3*c^2*d^2 + 5*c*d^3 + 2*d^4)*cos(f*x +
 e) + (6*c^2*d^2 + 10*c*d^3 + 4*d^4 - (3*c*d^3 + 2*d^4)*cos(f*x + e)^2 + (3*c^2*d^2 + 5*c*d^3 + 2*d^4)*cos(f*x
 + e))*sin(f*x + e))*sqrt(c^2 - d^2)*arctan(-(c*sin(f*x + e) + d)/(sqrt(c^2 - d^2)*cos(f*x + e))) + (2*c^5 - 5
*c^4*d - 16*c^3*d^2 - 8*c^2*d^3 + 14*c*d^4 + 13*d^5)*cos(f*x + e) - (c^5 - c^4*d - 2*c^3*d^2 + 2*c^2*d^3 + c*d
^4 - d^5 - (c^4*d - 6*c^3*d^2 - 11*c^2*d^3 + 6*c*d^4 + 10*d^5)*cos(f*x + e)^2 - (c^5 - 4*c^4*d - 14*c^3*d^2 -
10*c^2*d^3 + 13*c*d^4 + 14*d^5)*cos(f*x + e))*sin(f*x + e))/((a^2*c^6*d - 2*a^2*c^5*d^2 - a^2*c^4*d^3 + 4*a^2*
c^3*d^4 - a^2*c^2*d^5 - 2*a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e)^3 + (a^2*c^7 - 5*a^2*c^5*d^2 + 2*a^2*c^4*d^3 + 7
*a^2*c^3*d^4 - 4*a^2*c^2*d^5 - 3*a^2*c*d^6 + 2*a^2*d^7)*f*cos(f*x + e)^2 - (a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^
2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e) - 2*(a^2*c^7 - a^2*c^6
*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f + ((a^2*c^6*d - 2*
a^2*c^5*d^2 - a^2*c^4*d^3 + 4*a^2*c^3*d^4 - a^2*c^2*d^5 - 2*a^2*c*d^6 + a^2*d^7)*f*cos(f*x + e)^2 - (a^2*c^7 -
 a^2*c^6*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*d^7)*f*cos(f*x +
e) - 2*(a^2*c^7 - a^2*c^6*d - 3*a^2*c^5*d^2 + 3*a^2*c^4*d^3 + 3*a^2*c^3*d^4 - 3*a^2*c^2*d^5 - a^2*c*d^6 + a^2*
d^7)*f)*sin(f*x + e))]

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*sin(f*x+e))**2/(c+d*sin(f*x+e))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 320, normalized size = 1.45 \begin {gather*} \frac {2 \, {\left (\frac {3 \, {\left (3 \, c d^{2} + 2 \, d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{{\left (a^{2} c^{4} - 2 \, a^{2} c^{3} d + 2 \, a^{2} c d^{3} - a^{2} d^{4}\right )} \sqrt {c^{2} - d^{2}}} + \frac {3 \, {\left (d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c d^{3}\right )}}{{\left (a^{2} c^{5} - 2 \, a^{2} c^{4} d + 2 \, a^{2} c^{2} d^{3} - a^{2} c d^{4}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c\right )}} - \frac {3 \, c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 9 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 15 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, c - 8 \, d}{{\left (a^{2} c^{3} - 3 \, a^{2} c^{2} d + 3 \, a^{2} c d^{2} - a^{2} d^{3}\right )} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}\right )}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e))^2,x, algorithm="giac")

[Out]

2/3*(3*(3*c*d^2 + 2*d^3)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(c) + arctan((c*tan(1/2*f*x + 1/2*e) + d)/sqrt(c
^2 - d^2)))/((a^2*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*sqrt(c^2 - d^2)) + 3*(d^4*tan(1/2*f*x + 1/2*e) +
c*d^3)/((a^2*c^5 - 2*a^2*c^4*d + 2*a^2*c^2*d^3 - a^2*c*d^4)*(c*tan(1/2*f*x + 1/2*e)^2 + 2*d*tan(1/2*f*x + 1/2*
e) + c)) - (3*c*tan(1/2*f*x + 1/2*e)^2 - 9*d*tan(1/2*f*x + 1/2*e)^2 + 3*c*tan(1/2*f*x + 1/2*e) - 15*d*tan(1/2*
f*x + 1/2*e) + 2*c - 8*d)/((a^2*c^3 - 3*a^2*c^2*d + 3*a^2*c*d^2 - a^2*d^3)*(tan(1/2*f*x + 1/2*e) + 1)^3))/f

________________________________________________________________________________________

Mupad [B]
time = 10.49, size = 625, normalized size = 2.83 \begin {gather*} \frac {\frac {2\,\left (-2\,c^3+6\,c^2\,d+8\,c\,d^2+3\,d^3\right )}{3\,\left (c+d\right )\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (-5\,c^3+11\,c^2\,d+30\,c\,d^2+9\,d^3\right )}{3\,c\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (-3\,c^4+8\,c^3\,d+27\,c^2\,d^2+25\,c\,d^3+3\,d^4\right )}{3\,c\,\left (c+d\right )\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (-c^4+2\,c^3\,d+9\,c^2\,d^2+7\,c\,d^3+3\,d^4\right )}{c\,\left (c+d\right )\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (-c^4+2\,c^3\,d+3\,c^2\,d^2+d^4\right )}{c\,\left (c+d\right )\,\left (c-d\right )\,\left (c^2-2\,c\,d+d^2\right )}}{f\,\left (a^2\,c+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (3\,a^2\,c+2\,a^2\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (3\,a^2\,c+2\,a^2\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (4\,a^2\,c+6\,a^2\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (4\,a^2\,c+6\,a^2\,d\right )+a^2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\right )}-\frac {2\,d^2\,\mathrm {atan}\left (\frac {\frac {d^2\,\left (3\,c+2\,d\right )\,\left (-2\,a^2\,c^4\,d+4\,a^2\,c^3\,d^2-4\,a^2\,c\,d^4+2\,a^2\,d^5\right )}{a^2\,{\left (c+d\right )}^{3/2}\,{\left (c-d\right )}^{7/2}}-\frac {2\,c\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (3\,c+2\,d\right )\,\left (a^2\,c^4-2\,a^2\,c^3\,d+2\,a^2\,c\,d^3-a^2\,d^4\right )}{a^2\,{\left (c+d\right )}^{3/2}\,{\left (c-d\right )}^{7/2}}}{4\,d^3+6\,c\,d^2}\right )\,\left (3\,c+2\,d\right )}{a^2\,f\,{\left (c+d\right )}^{3/2}\,{\left (c-d\right )}^{7/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/((a + a*sin(e + f*x))^2*(c + d*sin(e + f*x))^2),x)

[Out]

((2*(8*c*d^2 + 6*c^2*d - 2*c^3 + 3*d^3))/(3*(c + d)*(c - d)*(c^2 - 2*c*d + d^2)) + (2*tan(e/2 + (f*x)/2)^2*(30
*c*d^2 + 11*c^2*d - 5*c^3 + 9*d^3))/(3*c*(c - d)*(c^2 - 2*c*d + d^2)) + (2*tan(e/2 + (f*x)/2)*(25*c*d^3 + 8*c^
3*d - 3*c^4 + 3*d^4 + 27*c^2*d^2))/(3*c*(c + d)*(c - d)*(c^2 - 2*c*d + d^2)) + (2*tan(e/2 + (f*x)/2)^3*(7*c*d^
3 + 2*c^3*d - c^4 + 3*d^4 + 9*c^2*d^2))/(c*(c + d)*(c - d)*(c^2 - 2*c*d + d^2)) + (2*tan(e/2 + (f*x)/2)^4*(2*c
^3*d - c^4 + d^4 + 3*c^2*d^2))/(c*(c + d)*(c - d)*(c^2 - 2*c*d + d^2)))/(f*(a^2*c + tan(e/2 + (f*x)/2)*(3*a^2*
c + 2*a^2*d) + tan(e/2 + (f*x)/2)^4*(3*a^2*c + 2*a^2*d) + tan(e/2 + (f*x)/2)^2*(4*a^2*c + 6*a^2*d) + tan(e/2 +
 (f*x)/2)^3*(4*a^2*c + 6*a^2*d) + a^2*c*tan(e/2 + (f*x)/2)^5)) - (2*d^2*atan(((d^2*(3*c + 2*d)*(2*a^2*d^5 - 4*
a^2*c*d^4 - 2*a^2*c^4*d + 4*a^2*c^3*d^2))/(a^2*(c + d)^(3/2)*(c - d)^(7/2)) - (2*c*d^2*tan(e/2 + (f*x)/2)*(3*c
 + 2*d)*(a^2*c^4 - a^2*d^4 + 2*a^2*c*d^3 - 2*a^2*c^3*d))/(a^2*(c + d)^(3/2)*(c - d)^(7/2)))/(6*c*d^2 + 4*d^3))
*(3*c + 2*d))/(a^2*f*(c + d)^(3/2)*(c - d)^(7/2))

________________________________________________________________________________________